Q = 47; % # of filters
N = 100; % N must be higher than 2*Q
Fs = 16000; % sampling frenquency
f = 1:Q;
fc = Fs/N * f; % central frequencies
b = Fs/N; % bandwidth

fc = fc + 50;
w_norm = 2*fc/Fs;

order = 500;
filban = zeros(Q,order+1);
for i=1:Q
    filban(i,:) = fir1(order,[w_norm(i)-b/Fs w_norm(i)+b/Fs]);
end

%figure();
%hold on;
%for j=1:Q
%    plot(linspace(-Fs/2,Fs/2,order+1),fftshift(10*log10(abs(fft(filban(j,:))))));
%end
%figure();

%plot(linspace(-Fs/2,Fs/2,order+1) , fftshift(10*log10(abs(fft(sum(filban,1))))));

k = 1.2;

pg = k.^(0:12);
pgr = round(pg);

filban2 = zeros(13,order+1);
temp = 1;
for i=1:13
    filban2(i,:) = sum(filban(temp:temp+pgr(i)-1,:),1);
    temp = temp + pgr(i);
end


figure();
hold on;
for j=1:13
    plot(linspace(-Fs/2,Fs/2,order+1),fftshift((abs(fft(filban2(j,:))))));
end
